package com.deliveryservicesystem.app.exceptions;

import java.util.ArrayList;
import java.util.List;

/**
 * File Name: IllegalOrphanException.java
 * Version:
 * Description:
 * Package: com.deliveryservicesystem.app.exceptions
 * Author: Lance
 * Date: Jun 20, 2012
 * Editor:
 */
public class IllegalOrphanException extends Exception
{

    private static final long serialVersionUID = 1L;
    private List<String> messages;

    /**
     *
     * @param messages Exception Messages
     */
    public IllegalOrphanException(List<String> messages)
    {
        super((messages != null && messages.size() > 0 ? messages.get(0) : null));
        if (messages == null)
        {
            this.messages = new ArrayList<>();
        }
        else
        {
            this.messages = messages;
        }
    }

    /**
     *
     * @return Exception Messages
     */
    public List<String> getMessages()
    {
        return messages;
    }
}
